
public class PizzaFactory {
	public enum PizzaType {SuncaCiuperci, Deluxe, Hawaiana}
	public static Pizza createPizza ( PizzaType tip)
	{
		switch(tip)
		{
		case SuncaCiuperci: return new Sunca_si_Ciuperci();
		case Deluxe: return new DeluxePizza();
		case Hawaiana: return new Hawai_Pizza();
		}
		throw new IllegalArgumentException("The pizza type " + tip + "is not recognize");
	}
}
